<style type="text/css">
.mui-popover .mui-popover-content{height:94.5%;}
.mui-setting-content .mui-popover .mui-table-view-cell .mui-badge{padding:0;margin:0;}
.mui-setting-content .mui-popover .mui-table-view-cell.avatar{line-height:40px;}
.mui-setting-content .mui-popover .mui-table-view-cell.avatar .upload-btn{position: absolute;top: 0;height: 100%;width: 100%;left: 0;}
.mui-setting-content .mui-popover .mui-table-view-cell.avatar .upload-btn div{ width:100%!important; height:100%!important;}
.mui-setting-content .mui-popover .mui-table-view-cell.avatar .head-img{margin-right: 20px;border-radius:10%;vertical-align: middle;}
.mui-popup-backdrop{ z-index:9999;}
#merch_detail textarea{border:none; padding:5px 10px;border-radius:10px;}
.mui-poppicker{ z-index:9999;}
.mui-poppicker~.mui-backdrop{z-index:9998;}
.webuploader-container{position: relative;}
.webuploader-pick {position: relative;display: inline-block;cursor: pointer;padding: 1px 5px;color: #fff;text-align: center;border-radius: 3px;overflow: hidden}
</style>
<div class="mui-setting-content">
{if $action == "home"}
    <div id="member" class="mui-popover mui-popover-left">
        <div class="mui-popover-header">个人资料<a href="#member" class="mui-pull-right mui-popover-close"><me class="mui-icon mui-icon-closeempty"></me></a></div>
        <div class="mui-popover-content">
            <div class="mui-scroll-wrapper">
                <div class="mui-scroll">
                    <ul class="mui-table-view">
                        <li class="mui-table-view-cell avatar">
                            <a id="head" class="mui-navigate-right">头像
                                <span class="mui-pull-right">
                                    <img class="head-img mui-action-preview" width="40" height="40" src="{$member['avatar']}">
                                </span>
                            </a>
                            <div class="upload-btn js-avatar-avatar" style="position:absolute;"></div>
                        </li>
                        <script>
                            util.img($('.js-avatar-avatar'), function(url){
                                $('.avatar img').attr('src', url.url);
                                $.post('./index.php?i={$_W["uniacid"]}&c=mc&a=profile&do=avatar&', {'avatar' : url.attachment}, function(data) {
                                    data = $.parseJSON(data);
                                    if (data.type == 'success') {
										$('.mui-media-object img').attr('src', url.url);
                                        util.toast(data.message);
                                    } else {
                                        util.toast('更新失败');
                                    }
                                })
                            }, {
                                crop : true,
								pxSize : 320,
								aspectRatio:1/1
                            });
                        </script>
                        <li class="mui-table-view-cell" data-type="nickname">
                            <a>会员<span class="mui-badge mui-badge-inverted">{$_W['member']['groupname']}</span></a>
                        </li>
                        <li class="mui-table-view-cell js-change" data-type="nickname">
                            <a>昵称<span class="mui-badge mui-badge-inverted">{$member['nickname']}</span></a>
                        </li>
                        <li class="mui-table-view-cell js-change" data-type="realname">
                            <a>姓名<span class="mui-badge mui-badge-inverted">{$member['realname']}</span></a>
                        </li>
                        <li class="mui-table-view-cell js-change" data-type="gender">
                            <a>性别<span class="mui-badge mui-badge-inverted">{$member['gender']}</span></a>
                        </li>
                    </ul>
                    <ul class="mui-table-view">
                        <li class="mui-table-view-cell">
                            <a href="{php echo app_url('member/bond/mobile',array('setting'=>1))}">手机号<span class="mui-badge mui-badge-inverted{if empty($member['mobile'])} mui-text-primary{/if}">{if empty($member['mobile'])}待绑定{else}{$member['mobile']}{/if}</span></a>
                        </li>
                        <li class="mui-table-view-cell js-change" data-type="qq">
                            <a>QQ号<span class="mui-badge mui-badge-inverted{if empty($member['qq'])} mui-text-primary{/if}">{if empty($member['qq'])}待绑定{else}{$member['qq']}{/if}</span></a>
                        </li>
                        <li class="mui-table-view-cell" style="display:none">
                            <a>邮箱地址<span class="mui-badge mui-badge-inverted">{$member['email']}</span></a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <script>
    	$(".js-change").on('tap',function(e) {
			e.detail.gesture.preventDefault(); //修复iOS 8.x平台存在的bug，使用plus.nativeUI.prompt会造成输入法闪一下又没了
			var $this = $(this);
			var placeholder = '', params = '', value = '', type = $(this).data("type");
			switch(type){
				case 'nickname':placeholder = '请输入新的昵称';break;
				case 'realname':placeholder = '请输入真实姓名';break;
				case 'qq'      :placeholder = '请输入您的QQ';break;
				default:break;
			}
			if (type!='gender'){
				mui.prompt('资料修改', placeholder,' ', function(e) {
					if (e.index == 1) {
						value = e.value;
						if ($.trim(value)==''){
							util.tips('更改信息不能为空');
							return false;
						}
						switch(type){
							case 'nickname':params = {'nickname' : value, type : type};break;
							case 'realname':params = {'realname' : value, type : type};break;
							case 'qq'      :params = {'qq' : value, type : type};break;
							default:break;
						}
						//console.log(params);
						$.post("{php echo app_url('member/profile/mc');}", params, function(data) {
							data = $.parseJSON(data);
							if (data.type == 'success') {
								util.toast(data.message);
								$this.find('span').removeClass('mui-text-primary').text(value);
							} else {
								util.toast(data.message);
							}
						})
					}
				});
			}else{
				var options = {data: [{"text":"\u4fdd\u5bc6","value":0},{"text":"\u7537","value":1},{"text":"\u5973","value":2}]};
				var $this = $(this);
				util.poppicker(options, function(items){
					$.post("{php echo app_url('member/profile/mc');}", {'gender' : items[0].value, type : type}, function(data) {
						data = $.parseJSON(data);
						if (data.type == 'success') {
							util.toast(data.message);
							$this.find('span').removeClass('mui-text-primary').text(items[0].value==1?'男':(items[0].value==2?'女':'保密'));
						} else {
							util.toast(data.message);
						}
					})
				});
			}
		});
    </script>
{elseif $action == "merch"}
	{if $op == 'display'}
    <div id="merch" class="mui-popover mui-popover-left">
        <div class="mui-popover-header">主办方资料<a href="#merch" class="mui-pull-right mui-popover-close"><me class="mui-icon mui-icon-closeempty"></me></a></div>
        <div class="mui-popover-content">
            <div class="mui-scroll-wrapper">
                <div class="mui-scroll">
                    <ul class="mui-table-view">
                        <li class="mui-table-view-cell avatar">
                            <a id="head" class="mui-navigate-right">头像
                                <span class="mui-pull-right">
                                	{if empty($merchant['logo'])}<font class="mui-text-primary">待完善 </font>{/if}
                                    <img class="head-img mui-action-preview" width="40" height="40" src="{$merchant['logo']}">
                                </span>
                            </a>
                            <div class="upload-btn js-avatar-avatar" style="position:absolute;"></div>
                        </li>
                        <script>
                            util.img($('.js-avatar-avatar'), function(url){
                                $('.avatar img').attr('src', url.url);
                                $.post("{php echo app_url('member/profile/merch');}", {'logo' : url.attachment,'type':'logo'}, function(data) {
                                    data = $.parseJSON(data);
                                    if (data.type == 'success') {
										$('.mui-media-object img').attr('src', url.url);
                                        util.toast(data.message);
                                    } else {
                                        util.toast('更新失败');
                                    }
                                })
                            }, {
                                crop : true,
								pxSize : 320,
								aspectRatio:1/1
                            });
                        </script>
                        <li class="mui-table-view-cell js-change" data-type="name">
                            <a>名称<span class="mui-badge mui-badge-inverted{if empty($merchant['name'])} mui-text-primary{/if}">{if empty($merchant['name'])}待完善{else}{$merchant['name']}{/if}</span></a>
                        </li>
                        <li class="mui-table-view-cell js-change-detail js-popover-sub" data-popover="merch_detail">
                            <a class="mui-navigate-right">简介<span class="mui-badge mui-badge-inverted{if empty($merchant['detail'])} mui-text-primary{/if}">{if empty($merchant['detail'])}待完善{/if}</span></a>
                        </li>
                    </ul>
                    <ul class="mui-table-view">
                        <li class="mui-table-view-cell js-change" data-type="linkman_mobile">
                            <a>手机号<span class="mui-badge mui-badge-inverted{if empty($merchant['linkman_mobile'])} mui-text-primary{/if}">{if empty($merchant['linkman_mobile'])}待绑定{else}{$merchant['linkman_mobile']}{/if}</span></a>
                        </li>
                        <li class="mui-table-view-cell js-change" data-type="linkman_name">
                            <a>联系人<span class="mui-badge mui-badge-inverted{if empty($merchant['linkman_name'])} mui-text-primary{/if}">{if empty($merchant['linkman_name'])}待完善{else}{$merchant['linkman_name']}{/if}</span></a>
                        </li>
                        <li class="mui-table-view-cell js-change" data-type="qq" style="display:none">
                            <a>QQ号<span class="mui-badge mui-badge-inverted{if empty($member['qq'])} mui-text-primary{/if}">{if empty($member['qq'])}待绑定{else}{$member['qq']}{/if}</span></a>
                        </li>
                        <li class="mui-table-view-cell" style="display:none">
                            <a>邮箱地址<span class="mui-badge mui-badge-inverted">{$member['email']}</span></a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div id="merch_detail" class="mui-popover mui-popover-left mui-popover-sub">
        <div class="mui-popover-header">简介
        	<a class="mui-pull-right mui-popover-close js-popover-sub-close" data-popover="merch_detail"><me class="mui-icon mui-icon-closeempty"></me></a>
        </div>
        <div class="mui-popover-content">
            <div class="mui-scroll-wrapper">
                <div class="mui-scroll">
                	<div class="mui-content-padded">
                    	<textarea id="textarea" class="mui-input-clear" name="detail" rows="5" placeholder="请输入主办方简介，最多70字">{$merchant['detail']}</textarea>
                    </div>
                    <div class="mui-content-padded">
                        <button type="button" class="mui-btn mui-btn-orange mui-btn-block js-change" data-type="detail">保存</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
    	$(".js-change").on('tap',function(e) {
			e.detail.gesture.preventDefault(); //修复iOS 8.x平台存在的bug，使用plus.nativeUI.prompt会造成输入法闪一下又没了
			var $this = $(this);
			var placeholder = '', params = '', value = '', type = $(this).data("type");
			if (type!='detail'){
				switch(type){
					case 'name'          :placeholder = '请输入主办方名称';break;
					case 'linkman_mobile':placeholder = '请输入联系方式';break;
					case 'linkman_name'  :placeholder = '请输入联系人姓名';break;
					default:break;
				}
				mui.prompt('资料修改', placeholder,' ', function(e){
					if (e.index == 1) {
						value = e.value;
						if ($.trim(value)==''){
							util.tips('更改信息不能为空');
							return false;
						}
						switch(type){
							case 'name'          :params = {name : value, type : type};break;
							case 'linkman_mobile':params = {linkman_mobile : value, type : type};break;
							case 'linkman_name'  :params = {linkman_name : value, type : type};break;
							default:break;
						}
						//console.log(params);
						$.post("{php echo app_url('member/profile/merch');}", params, function(data) {
							data = $.parseJSON(data);
							if (data.type == 'success') {
								util.toast(data.message);
								$this.find('span').removeClass('mui-text-primary').text(value);
							} else {
								util.tips(data.message);
							}
						})
					}
				});
			}else{
				$('#merch_detail #textarea').blur();
				var value= $('#merch_detail #textarea').val();
				if ($.trim(value)==''){
					util.tips('简介信息不能为空');
					return false;
				}
				$.post("{php echo app_url('member/profile/merch');}", {detail : value, type : 'detail'}, function(data) {
					data = $.parseJSON(data);
					if (data.type == 'success') {
						util.tips(data.message);
						$('#merch_detail #textarea').val(value);
						$('.js-change-detail').find('span').removeClass('mui-text-primary').text('');
						setTimeout(function() {
							$('#merch_detail').removeClass('mui-active').fadeOut();
							$('body').find('.mui-backdrop-sub').remove();
						},500);
					} else {
						util.tips(data.message);
					}
				});
			}
		});
    </script>
    {elseif $op == "hexiao"}
    	<style type="text/css">
		.mui-input-row label,.mui-input-row .mui-label{color:#6e6e6e;}
		.group-list .mui-input-row{background-color:#fff!important;}
		.group-list .mui-input-row label~input{text-align: right;}
		.group-list .mui-input-row .mui-label{width:100%; padding-left:15px;}
		.group-list .mui-input-row .mui-ext-icon,.group-child .mui-input-row .mui-ext-icon{position:absolute;top:0;z-index:10;width:40px;height:40px;line-height:41.5px;text-align:center;color:#ccc;font-size:18px;}
		.group-list .mui-input-row .mui-icon-remove,.group-child .mui-input-row .mui-icon-remove{right:0;}
		.group-list .mui-input-row.mui-help .mui-help-info{width:65%;padding-right:35px;}
		.group-list .mui-input-row.mui-help .mui-help-info{text-align:right;}
		.group-list .mui-input-row.mui-help .mui-help-info .mui-badge{font-size:14px;margin-top:2px;border:0;color:#ccc}
		.group-child .mui-input-row input{padding-left:35px;}
		.mui-input-row .mui-switch{margin-right:12px;}
		.mui-input-group .mui-input-cell:after{height:0;}
		.mui-image-uploader .file-item .file-title{position:absolute;left:0;bottom:0;line-height:1.6;width:100%;padding:0 5px; font-size:75%; color:#fff;background: rgba(0,0,0,0.5);}
		.map-container{position: fixed;top: 0; left:0;bottom: 0; right:0;z-index:9999;height:auto;overflow: hidden; background:#FFF;}
		.map-container iframe{width:100%;height:100%;padding-bottom:60px;border: none;}
		</style>
    	<div id="merch_saler" class="mui-popover mui-popover-left">
            <div class="mui-popover-header">核销员设置
                <a class="mui-pull-right mui-popover-close js-popover-close" data-popover="merch_saler"><me class="mui-icon mui-icon-closeempty"></me></a>
            </div>
            <div class="mui-popover-content">
            	<form id="formsaler" action="" method="post" onSubmit="return check(this)">
                <div class="mui-scroll-wrapper">
                    <div class="mui-scroll">
                    	<h5 class="mui-content-padded"></h5>
                    	<div class="mui-input-group">
                            <div class="mui-input-cell">
                                <div class="mui-table-view-chevron">
                                    <div class="mui-image-uploader">
                                        <div class="mui-image-preview js-saler-preview"></div>
                                        <a href="javascript:;" class="mui-upload-btn mui-inline webuploader-container">
                                            <div class="webuploader-pick js-popover-sub" data-popover='mui_search' data-type="saler"></div>
                                            <div class="btn-intro" style="position:absolute;color:#d7d7d7;top:54px;line-height: 1.2; left:0; right:0;">添加核销员<br>(支持多个)</div>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <h5 class="mui-content-padded"></h5>
                        <div class="mui-input-group group-list">
                            <div class="js-store-preview"></div>
                            <div class="mui-input-row js-saler-status">
                                <label>是否启用</label>
                                <div class="mui-switch mui-switch-mini mui-active">
                                    <div class="mui-switch-handle"></div>
                                    <input type="hidden" name="status" value="1">
                                </div>
                            </div>
                        </div>
                        <div class="mui-text-primary" style="background:#fff;overflow:hidden">
                            <div class="mui-content-padded mui-text-center js-popover-sub" data-popover="mui_search" data-type="store">+添加核销场地</div>
                        </div>
                        <div class="mui-content-padded">
                        	<input type="hidden" name="id" value="" />
                            <input type="hidden" name="type" value="saler">
                            <input type="submit" class="mui-btn mui-btn-orange mui-btn-block" name="submit" value="保存"/>
                        </div>
                    </div>
                </div>
                </form>
            </div>
        </div>

        <div id="merch_store" class="mui-popover mui-popover-left">
            <div class="mui-popover-header">场地设置
                <a class="mui-pull-right mui-popover-close js-popover-close" data-popover="merch_store"><me class="mui-icon mui-icon-closeempty"></me></a>
            </div>
            <div class="mui-popover-content">
            	<form id="formstore" action="" method="post" onSubmit="return check(this)">
                <div class="mui-scroll-wrapper">
                    <div class="mui-scroll">
                    	<h5 class="mui-content-padded"></h5>
                    	<div class="mui-input-group group-list">
                            <div class="mui-input-row">
                                <label>场地名称</label>
                                <input type="text" name="storename" placeholder="(必填)" value="">
                            </div>
                            <div class="mui-input-row">
                                <label>联系电话</label>
                                <input type="text" name="tel" placeholder="(选填)" value="">
                            </div>
                            <div class="mui-input-row mui-help js-map js-address" data-type="map">
                                <label>位置位置</label>
                                <div class="mui-help-info mui-navigate-right mui-text-right mui-ellipsis"><span class="mui-badge mui-badge-inverted">(必须)</span></div>
                                <input type="hidden" value="" name="address">
                                <input type="hidden" value="" name="map[lat]">
                                <input type="hidden" value="" name="map[lng]">
                                <input type="hidden" value="" name="map[adinfo]">
                            </div>
                            <div class="mui-input-row js-store-status">
                                <label>是否启用</label>
                                <div class="mui-switch mui-switch-mini mui-active">
                                    <div class="mui-switch-handle"></div>
                                    <input type="hidden" name="status" value="1">
                                </div>
                            </div>

                        </div>
                        <div class="mui-content-padded">
                            <input type="hidden" name="id" value="" />
                            <input type="hidden" name="type" value="store">
                            <input type="submit" class="mui-btn mui-btn-orange mui-btn-block" name="submit" value="保存"/>
                        </div>
                    </div>
                </div>
                </form>
            </div>
        </div>

        <div id="mui_search" class="mui-popover mui-popover-left mui-popover-sub">
            <form action="" method="post" onsubmit="return check_search(this)" style="position: initial">
            <div class="mui-popover-header">
                <div class="mui-input-row mui-search" style="margin:0;width:85%; background:none;">
                    <input type="search" name="keyword" class="mui-input-clear" placeholder="输入微信昵称" data-input-clear="1" data-input-search="1" value="">
                    <input type="hidden" name="type" value="saler">
                    <span class="mui-icon mui-icon-clear"></span>
                    <span class="mui-placeholder"><span class="mui-icon mui-icon-search"></span></span>
                </div>
                <a class="mui-pull-right mui-popover-close js-popover-sub-close" data-popover="mui_search" style="right: -30px;padding: inherit;">取消&nbsp;</a>
            </div>
            </form>
            <div class="mui-popover-content" id="searchlist">
                <div class="mui-scroll-wrapper-ext" data-scroll="4">
                    <div class="mui-scroll-ext">
                    	<div class="list-content">
                        	<ul class="mui-table-view" style="margin:0;max-height:none;"></ul>
                       </div>
                    </div>
                </div>
            </div>
        </div>
        <script type="text/html" id="tpl_saler_earch">
		<li class="mui-table-view-cell mui-media">
			<a href="javascript:;" class="js-set-hexiao" data-openid="{{d.openid}}" data-nickname="{{d.member.nickname}}" data-type="saler">
				<img class="mui-media-object mui-pull-left" src="{{d.member.avatar}}">
				<div class="mui-media-body" style="padding:inherit">
					<div class="mui-pull-left" style="width:75%"><span class="mui-ellipsis-1">{{d.member.nickname}}</span></div>
					<div class="mui-pull-right"><p><font class="mui-text-orange">选择</font></p></div>
				</div>
			</a>
		</li>
		</script>
        <script type="text/html" id="tpl_store_earch">
		<li class="mui-table-view-cell mui-media">
			<a href="javascript:;" class="js-set-hexiao" data-storename="{{d.storename}}" data-id="{{d.id}}" data-type="store">
				<div class="mui-media-body" style="padding:inherit">
					<div class="mui-pull-left" style="width:75%"><span class="mui-ellipsis-1">{{d.storename}}</span></div>
					<div class="mui-pull-right"><p><font class="mui-text-orange">选择</font></p></div>
				</div>
			</a>
		</li>
		</script>
        <script type="text/html" id="tpl_saler">
		<div class="file-item js-saler-item">
			<img src="{{d.avatar}}">
			<input type="hidden" name="openids[]" value="{{d.openid}}">
			<div class="file-title mui-ellipsis"><span>{{d.nickname}}</span></div>
			<div class="file-panel js-remove"><span>×</span></div>
		</div>
		</script>
        <script type="text/html" id="tpl_store">
		<div class="mui-input-row mui-help js-store-item" storeid="{{d.id}}">
			<i class="mui-ext-icon mui-icon-remove js-remove"></i>
			<span class="mui-label js-form-edit" data-id="gender">{{d.storename}}</span>
			<input type="hidden" value="{{d.id}}" name="storeids[]">
		</div>
		</script>
		<script>
			//数据发送
			function postData(type){
				$.post("{php echo app_url('member/merch/hexiao', array('opp'=>'post'))}", $('#form'+type).serialize(), function(data){
					if (!data.errno){
						var key = (type=='saler' ? 0 : 1);
						util.tips('操作成功，刷新中！');
						setTimeout(function() {mui('#merch_'+type).popover('toggle')}, 500);
						setTimeout(function() {
							$("#item"+key).find('.mui-table-view').html('');
							$("#item"+key).find('.dropload-down').remove();
							loadItem('#item'+key, type);
						}, 1000);
					}else{
						util.tips('没有发生改变！');
					}
				},"json");
			}
			function check(form){
				if (form['type'].value == 'saler') {
					if (!$("input[name='openids[]']").length) {
						util.tips('请设置一个核销员');
						return false;
					}
				}else{
					if ($.trim(form['storename'].value) == '') {
						util.alert('场地名称不能为空', ' ', function() {
							$(form['storename']).focus();
						});
						return false;
					}
					if ($.trim(form['address'].value) == '') {
						util.alert('位置不能为空', ' ', function() {
							$('.js-map').trigger('tap');
						});
						return false;
					}
				}

				postData(form['type'].value);
				return false;
			}
			//核销编辑
			$('body').delegate('.js-popover','tap', function(e) {
				$('.js-saler-preview').html('');
				$('.js-store-preview').html('');
				var type = $(this).data("popover")=="merch_saler" ? 'saler' : 'store';
				$('#form'+type).find("input[name='id']").val($(this).data("id"));
				if ($(this).data("id")) {
					mui.getJSON("{php echo app_url('member/merch/hexiao', array('opp'=>'post'))}", {id:$(this).data("id"), 'type':type},
					function(data){
						if (type=='saler'){//核销员
							var tpl_saler = document.getElementById('tpl_saler').innerHTML;
							var tpl_store = document.getElementById('tpl_store').innerHTML;
							for(var i = 0; i < data.member.length; i++){
								laytpl(tpl_saler).render(data.member[i], function(html){
									$('.js-saler-preview').append(html);
								});
							}
							for(var i = 0; i < data.stores.length; i++){
								laytpl(tpl_store).render(data.stores[i], function(html){
									$('.js-store-preview').append(html);
								});
							}
						}
						if (type=='store'){//门店
							$('#formstore').find("input[name='storename']").val(data.storename);
							$('#formstore').find("input[name='tel']").val(data.tel);

							$('.js-address').find('.mui-badge').text(data.address);
							$('.js-address').find("input").eq(0).val(data.address).next().val(data.lat).next().val(data.lng).next().val(data.adinfo);
						}
						//状态
						$('.js-'+type+'-status').find("input[name='status']").val(data.status);
						if (data.status==1) {
							$('.js-'+type+'-status').find('.mui-switch').addClass('mui-active');
							$('.js-'+type+'-status').find('.mui-switch-handle').css('transform','translate(16px, 0px)');

						}else{
							$('.js-'+type+'-status').find('.mui-switch').removeClass('mui-active');
							$('.js-'+type+'-status').find('.mui-switch-handle').css('transform','translate(0px, 0px)');
						}
					});
				}else{
					$('#formstore').find("input[name='storename']").val('');
					$('#formstore').find("input[name='tel']").val('');
					$('.js-address').find('.mui-badge').text('(必须)');
					$('.js-address').find("input").eq(0).val('').next().val('').next().val('').next().val('');
				}
			});
			//核销搜索控制
			$(".js-popover-sub").on('tap',function(e) {
				var type = $(this).data('type'),
					placeholder = type=='saler' ? '输入微信昵称' : '输入场地名称，直接搜索显示所有门店';
				$('#mui_search').find("input[name='keyword']").attr('placeholder', placeholder);
				$('#mui_search').find("input[name='type']").val(type);
				if($('#searchlist').find('.js-set-hexiao').length && !$('#searchlist').find('.js-set-hexiao[data-type="'+type+'"]').length){
					$('#searchlist').find('.list-content .mui-table-view').html('');
					$('#searchlist').find('.dropload-down').remove();
				}
			});
			var loadSearch=function(id, type, keyword){
				var thispage = 1;
				$(id).find('.mui-scroll-ext').dropload({
					scrollArea : $(id).find('.mui-scroll-wrapper-ext'),
					threshold : 50,
					loadDownFn : function(me){
						mui.getJSON("{php echo app_url('member/merch/hexiao',array('opp'=>'search'))}",{page:thispage,type:type,keyword:keyword},
						function(data){
							//console.log(data);
							var stime = new Date(),result='';
							if (data.tpage == 0){
								result = '<div class="no-orders-at-all">'
								+'<div class="head-block">'
								+'    <p class="recommend-hint"></p>'
								+'</div></div>';
								$(id).find('.list-content').append(result);
							}
							if (thispage >= data.tpage || data.tpage == 0){
								me.lock();// 锁定
								me.noData();// 无数据
							}

							var gettpl = document.getElementById('tpl_'+type+'_earch').innerHTML;
							for(var i = 0; i < data.list.length; i++){
								laytpl(gettpl).render(data.list[i], function(html){
									$(id).find('.list-content .mui-table-view').append(html);
								});
							}

							thispage++;
							// 每次数据加载完，必须重置
							me.resetload();
						});
					}
				});

			};
			function check_search(form){
				if ($.trim(form['keyword'].value) == '' && form['type'].value == 'saler') {
					util.tips('关键词不能为空');
					return false;
				}else{
					$('#searchlist').find('.dropload-down').remove();
					$('#searchlist').find('.no-orders-at-all').remove();
					$('#searchlist').find('.list-content .mui-table-view').html('');
					loadSearch('#searchlist', form['type'].value, $.trim(form['keyword'].value));
				}
				return false;
			}
			//开关
			$('.mui-switch').on('tap',function(e){
				if ($(this).hasClass("mui-active")){
					$(this).find('input').val(1);
				}else{
					$(this).find('input').val(0);
				}
				//console.log("你启动了开关");
			});
			//选择核销员
			$("#searchlist").delegate('.js-set-hexiao', 'tap',function(e) {
				var hh = '', istrue = true, _this = this, type = $(this).data('type');
				if (type == 'store'){
					if($('.js-store-item[storeid="' + $(this).data('id') +'"]').length>0){
						util.tips('场地不能重复');
						return;
					}
					hh += '<div class="mui-input-row mui-help js-store-item" storeid="' + $(this).data('id') +'">'
					+'	<i class="mui-ext-icon mui-icon-remove js-remove"></i>'
					+'	<span class="mui-label js-form-edit" data-id="gender">' +$(this).data('storename') +'</span>'
					+'	<input type="hidden" value="' + $(this).data('id') +'" name="storeids[]">'
					+'</div>';
				}else{
					$("input[name='openids[]']").each(function(){
						if ($(this).val()==$(_this).data("openid")){
							util.tips('核销员不能重复');
							istrue = false;
							return false;
						}
					});
					if (!istrue) return false;
					hh += '<div class="file-item js-saler-item">'
					+'	<img src="'+$(this).find("img").attr("src")+'">'
					+'	<input type="hidden" name="openids[]" value="'+$(this).data("openid")+'">'
					+'	<div class="file-title mui-ellipsis"><span>'+$(this).data("nickname")+'</span></div>'
					+'	<div class="file-panel"><span>×</span></div>'
					+'</div>';
				}
				$(".js-"+type+"-preview").append(hh);
				setTimeout(function() {
					$('#mui_search').removeClass('mui-active').fadeOut();
					$('body').find('.mui-backdrop-sub').remove();
				},500);
			});
			//移除核销员、核销场地
			$('#merch_saler').delegate(".js-remove","tap",function(e){
				var $this = $(this);
				$this.parents('.js-saler-item').remove();
				$this.parents('.js-store-item').remove();
			});
        </script>
    {/if}
{elseif $action == "project"}
<style type="text/css">
.mui-table-view.mui-form-btn{padding:0!important;margin:0!important;}
.mui-table-view.mui-form-btn,.mui-table-view.mui-form-btn .mui-table-view-cell{border-radius:0!important;}
.mui-table-view.mui-form-btn .mui-table-view-cell{float:left; width:23.111%; margin-right:1.5%;padding:3px 0!important; margin-bottom:3px;}
.mui-table-view.mui-form-btn:nth-child(5) .mui-table-view-cell{width:47.666%;}
.mui-table-view.mui-form-btn .mui-table-view-cell:after{height:0!important;}
.mui-table-view.mui-form-btn .mui-table-view-cell a{margin:0!important;border-radius:5px!important;color:#333;line-height:2; font-size:12px;font-family: "Microsoft Yahei","微软雅黑",Arial,"Hiragino Sans GB","宋体","Helvetica Neue",Helvetica,sans-serif;}
.mui-table-view.mui-form-btn .mui-table-view-cell a:after{content:" ";width:199%;height:200%;position: absolute;top: 0;left: 0;border: 1px solid #aaa;box-sizing: border-box;border-radius:10px;-webkit-transform: scale(0.5);transform: scale(0.5);-webkit-transform-origin: 0 0;transform-origin: 0 0;}
.mui-table-view.mui-form-btn .mui-table-view-cell a.mui-active{color:#008fe0; background: none;}
.mui-table-view.mui-form-btn .mui-table-view-cell a.mui-active:after{border: 1px solid #008fe0;}
.mui-input-row{background-color:#fff!important;}
.group-list .mui-input-row {cursor:move;}
.group-list .mui-input-row label:first-child{width:100%;}
.group-list .mui-input-row .mui-label{width:100%; padding-left:145px;margin-left:-105px;}
.group-list .mui-input-row .mui-ext-icon,.group-child .mui-input-row .mui-ext-icon{position:absolute;top:0;z-index:10;width:40px;height:40px;line-height:41.5px;text-align:center;color:#ccc;font-size:18px;}
.group-list .mui-input-row .mui-icon-remove,.group-child .mui-input-row .mui-icon-remove{left:0;}
.group-list .mui-input-row .mui-icon-drag{right:0;}
.group-list .mui-input-row.sortable-ghost{opacity:0;}
.group-list .mui-input-row.sortable-drag{opacity:0.8;background:rgba(0,0,0,.05)}
.group-list .mui-input-row.sortable-drag.sortable-fallback{background:#fff;}
.group-list .mui-input-row.mui-help .mui-help-info{width:105px;}
.group-list .mui-input-row.mui-help .mui-help-info{text-align:right;}
.group-list .mui-input-row.mui-help .mui-help-info .mui-badge{font-size:14px;margin-top:2px;margin-right:65px;border:0;color:#ccc}
.group-list .mui-input-row.mui-help .mui-help-info input[type=checkbox]{width:25px;height:25px;right:40px;}
.group-list .mui-input-row.mui-help .mui-help-info input[type=checkbox]:before{font-size:25px;}
.group-child .mui-input-row input{padding-left:35px;}
</style>
<div id="map_selector" class="mui-popover mui-popover-action mui-popover-bottom">
	<ul class="mui-table-view">
        <li class="mui-table-view-cell js-map" data-type="map">
            <a href="javascript:;" class="mui-text-primary">设置场地</a>
        </li>
        <li class="mui-table-view-cell js-map" data-type="online">
            <a href="javascript:;" class="mui-text-primary">线上活动</a>
        </li>
    </ul>
    <ul class="mui-table-view">
        <li class="mui-table-view-cell js-popover-close" data-popover="map_selector">
            <a href="javascript:;" class="mui-text-gray">取消</a>
        </li>
    </ul>
</div>
<div id="act_form" class="mui-popover mui-popover-action mui-popover-bottom mui-popover-sub">
	<div class="mui-popover-content" style="min-height:220px; padding-right:0;">
    	<p></p>
    	<p>常用报名项</p>
        <ul class="mui-table-view mui-form-btn js-add-form" data-type="sys">
            <li class="mui-table-view-cell" data-type="gender"><a href="javascript:;">性别</a></li>
            <li class="mui-table-view-cell" data-type="age"><a href="javascript:;">年龄</a></li>
            <li class="mui-table-view-cell" data-type="birthyear"><a href="javascript:;">生日</a></li>
            <li class="mui-table-view-cell" data-type="idcard"><a href="javascript:;">证件</a></li>
            <li class="mui-table-view-cell" data-type="education"><a href="javascript:;">学历</a></li>
            <li class="mui-table-view-cell" data-type="company"><a href="javascript:;">公司</a></li>
            <li class="mui-table-view-cell" data-type="position"><a href="javascript:;">职位</a></li>
            <li class="mui-table-view-cell" data-type="occupation"><a href="javascript:;">职业</a></li>
            <li class="mui-table-view-cell" data-type="email"><a href="javascript:;">邮箱</a></li>
            <li class="mui-table-view-cell" data-type="resideprovince"><a href="javascript:;">城市</a></li>
        </ul>
        <p>自定义项</p>
        <ul class="mui-table-view mui-form-btn js-add-form" data-type="diy">
            <li class="mui-table-view-cell" data-type="3"><a href="javascript:;">+单行文本</a></li>
            <li class="mui-table-view-cell" data-type="4"><a href="javascript:;">+数字文本</a></li>
            <li class="mui-table-view-cell" data-type="0"><a href="javascript:;">+单选类型</a></li>
            <li class="mui-table-view-cell" data-type="1"><a href="javascript:;">+多选类型</a></li>
            <li class="mui-table-view-cell" data-type="2"><a href="javascript:;">+下拉选框</a></li>
            <li class="mui-table-view-cell" data-type="7"><a href="javascript:;">+日期类型</a></li>
            <li class="mui-table-view-cell" data-type="5"><a href="javascript:;">+单图上传</a></li>
            <li class="mui-table-view-cell" data-type="6"><a href="javascript:;">+多图上传</a></li>
        </ul>
    </div>
    <ul class="mui-table-view">
        <li class="mui-table-view-cell js-popover-sub-close" data-popover="act_form">
            <a href="javascript:;" class="mui-text-gray">取消</a>
        </li>
    </ul>
</div>
<div id="form_edit" class="mui-popover mui-popover-left mui-popover-sub">
	<div class="mui-popover-header">报名项编辑<a href="javascript:;" class="mui-pull-right mui-popover-close js-popover-sub-close" data-popover="form_edit"><me class="mui-icon mui-icon-closeempty"></me></a></div>
    <div class="mui-popover-content">
        <div class="mui-scroll-wrapper">
            <div class="mui-scroll">
            	<div class="mui-input-group">
                    <div class="mui-input-row">
                        <input name="form_title" value="" type="text" placeholder="">
                    </div>
                </div>
            	<div class="mui-input-group group-child js-child" style="display:none;"></div>
                <div class="mui-content-padded" style="padding-bottom:10px;">
                    <button type="button" class="mui-btn mui-btn-orange mui-btn-block js-save" data-type="form">完成</button>
                </div>
            </div>
		</div>
    </div>
</div>
<div id="act_setting" class="mui-popover mui-popover-left" >
	<div class="mui-popover-header">活动设置<a href="javascript:;" class="mui-pull-right mui-popover-close js-popover-close" data-popover="act_setting"><me class="mui-icon mui-icon-closeempty"></me></a></div>
	<div class="mui-popover-content">
        <div class="mui-scroll-wrapper-ext">
            <div class="mui-scroll-ext">
                <div class="mui-content-padded">
                    <p class="mui-pl5">设置用户报名时填写的表单</p>
                </div>
                <div id="forms" class="mui-input-group group-list">
                    <div class="mui-input-row">
                        <label class="js-form-edit" data-id="realname">{php echo empty($sysform['realname']['title'])?'姓名':$sysform['realname']['title']}</label>
                        <input name="activity[form][realname][title]" value="{php echo empty($sysform['realname']['title'])?'姓名':$sysform['realname']['title']}" type="hidden" placeholder="请输入姓名标题">
                        <input name="activity[form][realname][need]" value="1" type="hidden">
                    </div>
                    <div class="mui-input-row">
                        <label class="js-form-edit" data-id="mobile">{php echo empty($sysform['mobile']['title'])?'手机':$sysform['mobile']['title']}</label>
                        <input name="activity[form][mobile][title]" value="{php echo empty($sysform['mobile']['title'])?'手机':$sysform['mobile']['title']}" type="hidden" placeholder="请输入手机标题">
                        <input name="activity[form][mobile][need]" value="1" type="hidden">
                    </div>
                    {if count($sysform)>2}{php $sys_form = array_slice($sysform, 2);}
                    {loop $sys_form $k $form}
                    {php $form['id']=$k;$form['essential']=$form['need'];$form['fieldstype']=$k;}
                    {php include aide_template('activity/form');}
                    {/loop}{/if}
                    {loop $activityForm[0] $form}
                    <?php
                        switch ($form['displaytype'])
                        {
                            case '0': $form['placeholder'] = '输入单选标题'; break;
                            case '1': $form['placeholder'] = '输入多选标题'; break;
                            case '2': $form['placeholder'] = '输入下拉选框标题';break;
                            case '3': $form['placeholder'] = '输入单行文本标题';break;
                            case '4': $form['placeholder'] = '输入数字文本标题';break;
                            case '5': $form['placeholder'] = '输入单图上传标题';break;
                            case '6': $form['placeholder'] = '输入多图上传标题';break;
                            case '7': $form['placeholder'] = '输入日期标题';break;
                            default: $form['placeholder'] = '输入'.$form['title'].'标题';
                        }
                    ?>
                    {template 'activity/form'}
                    {/loop}
                </div>
                <div class="mui-text-primary" style="background:#fff;overflow:hidden">
                    <div class="mui-content-padded mui-text-center js-popover-sub" data-popover='act_form'>+添加自定义填写</div>
                </div>
                <div class="mui-content-padded" style="padding-bottom:10px;">
                    <button type="button" class="mui-btn mui-btn-orange mui-btn-block js-save">完成</button>
                    <p class="mui-text-gray" style="padding-top:5px; text-align:center">注：“姓名”和“手机”只可自定义名称；点击每个表单中间空白处可编辑；长按表单右侧"拖动符"拖动排序</p>
                </div>
            </div>
        </div>
	</div>
</div>
{if $_W['_config']['agreement']}
<div id="agreement" class="mui-popover mui-agreement-info">
	<div class="mui-popover-header">活动发布协议</div>
	<div class="mui-popover-content">
        <div class="mui-scroll-wrapper">
            <div class="mui-scroll">
            	<div class="mui-content-padded">{php echo htmlspecialchars_decode($_W['_config']['proagreement'])}</div>
            </div>
        </div>
    </div>
    <div class="mui-content-padded">
        <button type="button" class="mui-btn mui-btn-success mui-btn-block js-readagreement">已阅读并同意</button>
    </div>
</div>
{/if}
<script>
var fomrData = $('#forms').html(),fomrNeed = $('#forms .js-needFill'),formId;
require(['{aide_BASE}js/app/Sortable'], function (){
	var Sortable = new sortableFactory();
	Sortable.create(forms, {
		group: "forms",
		animation: 150,
		draggable: '.form_item',
		handle: '.mui-icon-drag',
		direction: 'Y',
		delay:100,
		onUpdate: function (evt){},
		onStart:function(evt){},
		onEnd: function(evt){}
	});
	$(document.body).delegate('#forms .mui-icon-drag','touchstart', function(e) {
		//e.preventDefault();
	});
	document.addEventListener('touchmove', function (e) {
	   e.returnValue = true;
	}, false);
});
if ($('#forms .form_item').length > 0){
	$('.js-setting').find("span.mui-badge").text('已设置');
}else{
	$('.js-setting').find("span.mui-badge").text('');
}
//表单编辑触发
$("#forms").delegate('.js-form-edit','tap',function(e) {
	formId = $(this).data('id');
	var form_title = $('input[name="form_title['+formId+']"]').val();
	var placeholder = $('input[name="form_title['+formId+']"]').attr('placeholder');
	if (formId=='realname'|| formId=='mobile'){
		form = 'input[name="activity[form]['+formId+'][title]"]';
		form_title = $(form).val();
		placeholder = $(form).attr('placeholder');
	}
	if ($('#form_item_' + formId).length>0){
		$('#form_edit').find('.js-child').html($('#form_item_' + formId).html()).show();
		if ($('#add-formitem').length==0)
		$('#form_edit').find('.js-child').after('<div class="mui-text-primary" id="add-formitem" style="background:#fff;overflow:hidden"><div class="mui-content-padded mui-text-center" onclick="addFormItem(\''+formId+'\')">+添加</div></div>');
	}else{
		$('#form_edit').find('.js-child').html('').hide();
		$('#form_edit').find('#add-formitem').remove();
	}
	$('#form_edit').find('input[name="form_title"]').val(form_title);
	$('#form_edit').find('input[name="form_title"]').attr('placeholder',placeholder);

	$('#form_edit').css('display','block')[0].offsetWidth;
	$('#form_edit').addClass('mui-active');
	$('body').append('<div class="mui-backdrop mui-active mui-backdrop-sub"></div>');
});
//表单编辑保存
$("#form_edit").delegate('.js-save', 'click', function(e) {
	var form = 'input[name="form_title['+formId+']"]';
	var form_title = $('#form_edit').find('input[name="form_title"]').val();
	var placeholder = $('#form_edit').find('input[name="form_title"]').attr('placeholder');
	if (formId=='realname'|| formId=='mobile'){
		form = 'input[name="activity[form]['+formId+'][title]"]';
	}
	$(form).val($.trim(form_title));
	$(form).siblings('.js-form-edit').text($.trim(form_title)!=''?$.trim(form_title):placeholder);
	if ($('#form_item_' + formId).length>0){
		$('#form_item_' + formId).html('');
		$("#form_edit .js-child .form_item_item").each(function(key){
			var form_item_title = $.trim($(this).find('input[name="form_item_title_'+formId+'[]"]').val());
			var form_item_item = $(this).clone().find('input[name="form_item_title_'+formId+'[]"]').attr("value", form_item_title).parents('.form_item_item');
			$('#form_item_' + formId).append(form_item_item);
		});
		$('#form_edit').find('.js-child').html('').hide();
	}
	$('#form_edit').removeClass('mui-active').fadeOut();
	$('body').find('.mui-backdrop-sub').remove();
});
//添加form_item
$(".js-add-form li").on('tap',function(e) {
	var type = $(this).parent().data('type');
	var form_type = $(this).data('type');
	var form_title = $(this).text();
	$('#act_form').removeClass('mui-active').fadeOut();
	$('body').find('.mui-backdrop-sub').remove();
	if (type == 'sys' && $("#forms").html().indexOf(form_type)!=-1){
			util.tips('常用选项不可重复添加');
			return false;
	}
	util.loading();
	$.ajax({
		type: 'POST',
		url: "{php echo app_url('activity/option/form')}",
		data: {type:type, form_type:form_type, title:form_title},
		success:function(data){
			util.loading().close();
			$('#forms').append(data);
			if (type == 'diy'){
				$('#forms .form_item:last').find('.js-form-edit').trigger('tap')
			}
		}
	});
});
//保存form_item
$('#act_setting .js-save').on('click', function(e) {
	fomrData = $('#forms').html();
	fomrNeed = $('#forms').find('.js-needFill');
	if ($('#forms .form_item').length > 0){
		$('.js-setting').find("span.mui-badge").text('已设置');
	}else{
		$('.js-setting').find("span.mui-badge").text('');
	}
	$("#act_setting").css('transition','transform .3s,opacity .3s');
	mui("#act_setting").popover('toggle');
});
//删除form_item
$('#forms').delegate('.js-remove', 'tap', function(e) {
	$(this).parent().remove();
});
//必填
$('#forms').delegate('.js-needFill', 'click', function(e) {
	var need = $(this).is(':checked')?"1":"0";
	$(this).siblings('input').val(need);
});
//添加form_item_item
function addFormItem(formid){
	var placeholder;
	var url = "{php echo app_url('activity/option/formitem')}" + "&formid=" + formid;
	var len = $('#form_edit').find('.js-child').find('.form_item_item').length;
	placeholder  = '输入选项'+(len+1);
	util.loading();
	$.ajax({
		"url": url,
		data: {placeholder:placeholder},
		success:function(data){
			util.loading().close();
			$('#form_edit').find('.js-child').append(data);
		}
	});
}
//删除form_item_item
function removeFormItem(obj){
	var siblings = $(obj).parents('.form_item_item').siblings('.form_item_item');
	$(obj).parents('.form_item_item').remove();
	siblings.each(function(key){
		$(this).find('.form_item_title').attr('placeholder','输入选项'+(key+1));
	});
}
//发布协议
$(".js-readagreement").on('tap',function(e) {
	$("input[name='agreement']").prop("checked", true);
	mui('#agreement').popover('toggle');
});
</script>
{/if}
</div>
<script>
mui('.mui-scroll-wrapper').scroll({indicators: false});
$('body').delegate('.js-popover','tap', function(e) {
	var popover = "#"+$(this).attr("data-popover");
	mui(popover).popover('toggle');
	if (popover=='#act_setting'){
		setTimeout(function(){$(popover).css('transition','none')}, 290);
	}
	//window.onpopstate = function (e) {}
	//history.pushState({page: "setting"}, "我的", "{php echo app_url('member/home/display#1');}");
});
$(".js-popover-close").on("click",function(e) {
	var popover = "#"+$(this).data("popover");
	if (popover=='#act_setting'){
		if (fomrData!=''){
			$('#forms').html(fomrData);
			fomrNeed.each(function(key){
				if ($(this).is(':checked')){
					$('#forms .js-needFill').eq(key).attr("checked", true);
				}else{
					$('#forms .js-needFill').eq(key).attr("checked", false);
				}
			});
		}
		$(popover).css('transition','transform .3s,opacity .3s');
	}
	mui(popover).popover('toggle');
});
$(".js-popover-sub").on('tap',function(e) {
	var popover = "#"+$(this).data("popover");
	$(popover).css('display','block')[0].offsetWidth;
	$(popover).addClass('mui-active');
	$('body').append('<div class="mui-backdrop mui-active mui-backdrop-sub"></div>');
	if (popover == '#mui_search') {
		var t = '{$keyword}';
		if (util.ios()){
			$("input[name='keyword']").focus().val(t);
		}else{

			setTimeout(function(){$("input[name='keyword']").focus().val(t);}, 520);
		}
	}
});
$('.js-popover-sub-close').on('click',function(e) {
	var popover = "#"+$(this).data("popover");
	$(popover).removeClass('mui-active').fadeOut();
	$('body').find('.mui-backdrop-sub').remove();
});
$('body').delegate('.mui-backdrop-sub','tap', function(e) {
	$(this).remove();
	$('.mui-popover-sub').removeClass('mui-active').fadeOut();
});

/*$.get("{php echo app_url('member/home/display#1');}").done(function (data) { $("#wrapper").html(data); });
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端

if (history.state){
	window.addEventListener("popstate", function() {
		var jsonstate = history.state;//获取当前所在的state
		console.log(jsonstate);
		if (jsonstate && jsonstate.page == 'setting') { //page即是pushState时设置的参数
			//history.go(-1);
		}else{
			mui("#setting").popover('toggle');
		}
	});
	window.onload = function(){
		setTimeout(function() {
			//mui("#setting").popover('toggle');
		},230);
	}
}*/
{if $action == "project" || $op == "hexiao"}
//地图控制
$('body').delegate('.js-map-select','click', function(e){
	var address = $('.map-container').find("iframe").contents().find("#addr_cur").val();
	var adinfo = $('.map-container').find("iframe").contents().find("#ad_info").val();
	if (address=='' || address==null){
		{if $op == "hexiao"}
		util.tips('坐标不能为空');
		{else}
		util.confirm('您确定不设置场地吗？', ' ', function(e) {
			if (e.index == 0) {
				return false;
			}else{
				$('.js-address').find("span.mui-badge").text('线上活动');
				$("input[name='activity[hasonline]']").val(1);
				$('.js-addname').hide();
				$('.map-container').hide();
			}
		});
		{/if}
	}else{
		var point = JSON.parse($('.map-container').find("iframe").contents().find("#poi_json").val());
		//$('.js-address').find(".mui-media-body span").text(address);
		$('.js-address').find("span.mui-badge").text(address);
		$('.js-address').find("input").eq(0).val(address).next().val(point.lat).next().val(point.lng).next().val(adinfo);
		$("input[name='activity[hasonline]']").val(0);
		$('.js-addname').show();
		$('.map-container').hide();
	}
});
$('.js-map').on('tap',function(e){
	mui('#map_selector').popover('toggle');
	var type = $(this).data("type");
	if (type=='map'){
		if (!$('div').hasClass('map-container')){
			$('body').append('<div class="map-container" style="display:none;" ><iframe class="embed-responsive-item" src="'+"{php echo app_url('map/map/tencent')}"+'" scrolling="no"></iframe><footer class="mui-bar mui-bar-footer"><botton type="botton" class="mui-btn mui-btn-orange mui-btn-block js-map-select">选择当前地址</botton></footer></div>');
		}
		$('.map-container').show();
	}else{
		//$('.js-address').find(".mui-media-body span").text('线上活动');
		$('.js-address').find("span.mui-badge").text('线上活动');
		$("input[name='activity[hasonline]']").val(1);
		$('.js-addname').hide();
	}

});
//地图控制结束
{/if}
</script>
